package com.guoxue.util;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class GetProperties {

	public static Properties getResource(){
		Properties props = new Properties();
		String url = props.getClass().getClassLoader().getResource(
		"resouce.properties").toString().substring(6);
		String empUrl = url.replace("%20", " ");
		System.out.println(empUrl);
		InputStream in = null;
		try {
		in = new BufferedInputStream(new FileInputStream(empUrl));
		props.load(in);
		} catch (FileNotFoundException e1) {
		System.out.println("未找到文件");
		e1.printStackTrace();
		} catch (IOException e1) {
		System.out.println("IO异常");
		e1.printStackTrace();
		}
		return props;
	}
	
}
